# CMake 最低版本号要求2.8
cmake_minimum_required(VERSION 2.8)

# 项目名称feature_match
project(feature_match)

# 设置编译方式Release

set(CMAKE_BUILD_TYPE Release)

# 支持C++11 -o3优化
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -Wall   -O3")


# 查找系统里的OpenCV，找不到输出警告信息

find_package(OpenCV 3 REQUIRED)

# .bashrc中增加 opencv的安装路径: export opencv_3_4_11=/home/hubery/lib/install/opencv_3.4.11/lib
# you can use next code to use opencv of the different version
# find_package(OpenCV REQUIRED PATHS $ENV{opencv_3_4_11} NO_DEFAULT_PATH)

# 添加项目包含路径

include_directories(
    ${OpenCV_INCLUDE_DIRS}
    ${PROJECT_SOURCE_DIR}/include
)


# 用源文件为工程添加可执行文件，名字和项目名称一致
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${PROJECT_SOURCE_DIR})
add_executable(${PROJECT_NAME} 
    ${PROJECT_SOURCE_DIR}/source/feature_matcher.cpp
    ${PROJECT_SOURCE_DIR}/source/vfc.cpp
)


# 可执行文件添加库链接

target_link_libraries(${PROJECT_NAME} ${OpenCV_LIBS})


